{extend name='admin@main'}

{block name="button"}

{if auth("add")}
<button data-modal='{:url("add")}?platform_id={$Think.get.platform_id|default=""}' data-title="添加计价规则" class='layui-btn layui-btn-sm layui-btn-primary'>添加计价规则</button>
{/if}

{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些添加计价规则吗？" class='layui-btn layui-btn-sm layui-btn-primary'>添加计价规则</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-center nowrap'>城市等级</th>
            <th class='text-center nowrap'>类型</th>
            <th class='text-center nowrap'>岗位</th>
            <th class='text-center nowrap'>价格</th>
            <th class='text-center nowrap'>日补贴</th>
            <th class='text-left nowrap'>添加时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.city_level' value='0'}<span class="layui-badge layui-bg-blue">L1城市</span>{/eq}
                {eq name='vo.city_level' value='1'}<span class="layui-badge layui-bg-orange">L2城市</span>{/eq}
                {eq name='vo.city_level' value='2'}<span class="layui-badge layui-bg-green">L3城市</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.type' value='0'}<span class="layui-badge layui-bg-blue">运力</span>{/eq}
                {eq name='vo.type' value='1'}<span class="layui-badge layui-bg-orange">分拣</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.jobs' value='0'}<span class="layui-badge layui-bg-blue">有车</span>{/eq}
                {eq name='vo.jobs' value='1'}<span class="layui-badge layui-bg-orange">无车</span>{/eq}
                {eq name='vo.jobs' value='2'}<span class="layui-badge layui-bg-green">标品</span>{/eq}
                {eq name='vo.jobs' value='3'}<span class="layui-badge layui-bg-gray">冻品</span>{/eq}
                {eq name='vo.jobs' value='4'}<span class="layui-badge layui-bg-cyan">大件</span>{/eq}
                {eq name='vo.jobs' value='5'}<span class="layui-badge">杂工</span>{/eq}
            </td>
            <td class='text-center nowrap'>{$vo.price|default=''}</td>
            <td class='text-center nowrap'>{$vo.subsidy|default=''}</td>
            <td class='text-left nowrap'>
                {$vo.create_at|format_datetime}
            </td>
            <td class='text-left nowrap'>

                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑信息" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该计价信息吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
